package daos;

import java.sql.Connection;
import org.apache.log4j.Logger;

import tools.ConnectionManager;

/**
 * AbstractDao class for communicating to database
 * @author Administrateur
 */
public abstract class AbstractDao<T> implements Dao<T>{

	private Connection connexion;
	private String tableName;
	public static Logger logger = (Logger) 
	Logger.getRootLogger();
	
	/**
	 * Constructeur
	 * 
	 */
	public AbstractDao() {
		this.setConnexion(ConnectionManager.getInstance());
	}

	/**
	 * Constructeur
	 */
	public AbstractDao(Connection c) {
		this.setConnexion(c);
	}

	/**
	 * @param _tableName the _tableName to set
	 */
	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	/**
	 * @return the _tableName
	 */
	public String getTableName() {
		return tableName;
	}

	/**
	 * @param connexion the connexion to set
	 */
	public void setConnexion(Connection connexion) {
		this.connexion = connexion;
	}

	/**
	 * @return the connexion
	 */
	public Connection getConnexion() {
		return connexion;
	}
}
